#include<bits/stdc++.h>
using namespace std;

int a[105], b[105];

signed main() {
    int n, k;
    cin >> n;

    for(int i = 1; i <= n; i++)
        cin >> a[i];

    cin >> k;
    while(k--) {
        int cnt = 0;
        for(int i = 1; i <= n; i++)
            cin >> b[i];

        for(int i = 1; i <= n; i++) {
            if(b[i] == a[i]) {
                cnt++;
            } else if(b[i]) {
                cnt = -1;
                break;
            }
        }

        if(cnt < 1)
            cout << "Ai Ya\n";
        else
            cout << "Da Jiang!!!\n";
    }

    return 0;
}

